<%--
  Created by IntelliJ IDEA.
  User: pcdalao
  Date: 2021/5/23
  Time: 0:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>购买产品测试</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>

        //模拟1000并发量
        for (var i = 0;i<3000;i++){
            var params = {
                userId:1,
                productId:1,
                quantity:1
            }
            $.post("./purchase",params,function (res) {
                //alert  (res.message)
                console.log(i +"-"+ res.message);
            });
        }

    </script>
</head>

<body>
    <h1>抢购产品测试</h1>

</body>

</html>
